 #设定工程名
PROJECT(cantest)
#设定最小版本号
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

#设定头文件目录
INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/include
   ${PROJECT_SOURCE_DIR}/include/can
)

#设定可执行二进制文件的目录长度
SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) 

#设定存放编译出来的库文件的目录
SET( LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) 

#并且把该目录设为连接目录
LINK_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib)

# 添加编译文件
ADD_EXECUTABLE(
   cantest          src/main.c
                        src/can_interface.c
)
#链接所需要的pthread 库
TARGET_LINK_LIBRARIES(cantest  pthread)